import request from '@/utils/request/request';
import {
  NewSerialNumberData,
  SerialDetailParams,
  SerialNumberId,
} from './model/serialNumberGenerate';

// 查询数据源配置列表
export function getSerialNumberList(params?: SerialDetailParams) {
  return request.get('/api/serial/number/page', {
    params,
  });
}
// 保存新增流水号
export function saveNewSerialNum(data: NewSerialNumberData) {
  return request.post('/api/serial/number/generateSerialNumber', {
    ...data,
  });
}
// 禁用流水号信息
export function disableSerialNumber(params: SerialNumberId) {
  return request.post(
    '/api/serial/number/disableSerialNumber',
    {},
    {
      params: { id: params },
    }
  );
}
// 启用流水号信息
export function enableSerialNumber(params: SerialNumberId) {
  return request.post(
    '/api/serial/number/enableSerialNumber',
    {},
    {
      params: { id: params },
    }
  );
}
